#ifndef CHARACTER_H
#define CHARACTER_H

#include "GameObject.h"
#include "CharacterID.h"
#include <iostream>

using namespace std;
class Character:
	public GameObject
{
private:
	ChaState m_CState; // trang thai cua nhan vat
	ChaFire m_CFire; // trang thai dan ban
	ChaPostion m_CPos; // vi tri cua nhan vat trong map
	float m_timeCol; // thoi gian va cham
	CInput *m_input;
	bool m_isFire; // dang ban
	

public:
	Character();
	~Character();

	void init();
	void update(float time);
	void setAnimation();
	void setRectCollsion();
	void draw();
	void destroy();
	
	// va cham voi cac doi tuong trong camera
	void colWithObject(float time);
	// xu ly dan ban
	void setFireBullet();
	// xu ly vi tri nhan vat trong map
	void processPostion();
	void processInput();

	// reset lai trang thai ban dau
	void resetState();
	// phan luc
	void counterVec(float vecX, float  vecY);

	void setCState(ChaState x){ m_CState = x; }
	ChaState getCState(){ return m_CState; }
	void setCFire(ChaFire x){ m_CFire = x; }
	ChaFire getCFire(){ return m_CFire; }
	void setCPos(ChaPostion x){ m_CPos = x; }
	ChaPostion getCPos(){ return m_CPos; }
	void isFire(bool x){ m_isFire = x; }
	bool isFire(){ return m_isFire; }
	
	GameObID getGameObID(){ return CHARACTER; }

};

#endif